package cn.tedu.blog.server.controller.api;

import cn.tedu.blog.server.pojo.vo.BannerListVO;
import cn.tedu.blog.server.service.IBannerService;
import cn.tedu.blog.server.utils.JsonResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/banner")
public class ApiBannerController {
    @Autowired
    private IBannerService bannerService;
    
    @GetMapping("/list")
    @ApiOperation("查询status=1的轮播图列表")
    public JsonResult listByStatus1() {
        List<BannerListVO> bannerListVOS = bannerService.listApiBanner();
        return JsonResult.ok(bannerListVOS);
    }
}
